﻿@model SMECustomerWebsite.Models.ViewModels.SalePerformance.DepositViewModel

@Html.Action("CustInfo", "System")
<!-- start accordion -->
<div class="row">
    <div class="col-md-12">
        <div class="x_panel">
            <div class="x_title">
                <div class="col-lg-8 col-md-9 col-sm-8">
                    @Html.Action("SubMenuKpiRawData", "System")
                    <h2 class="col-lg-8">THÔNG TIN NỢ XẤU TĂNG THÊM</h2>
                    <p class="col-lg-6">Chi tiết về các khoản nợ xấu phát sinh trong tháng</p>
                </div>
                <ul class="nav navbar-right panel_toolbox">
                    @Html.Action("BusinessDateInfo", "System", new { name = "TBL_KPI_MSBO_RAW" })
                    <li>
                        <a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                    </li>
                </ul>
                <div class="clearfix"></div>
            </div>
            <div class="x_content">
                <table id="cm-alert-badbank" class="table custom_table table-bordered table-striped jambo_table">
                    <thead class="headings">
                        <tr>
                            <th class="column-title">@SMECustomerWebsite.Core.Resources.Resource.CifHeader</th>
                            <th class="column-title">@SMECustomerWebsite.Core.Resources.Resource.NameHeader</th>
                            <th class="column-title">ACCTNO</th>
                            <th class="column-title">SỐ DƯ</th>
                            <th class="column-title">NHÓM SẢN PHẨM</th>
                            <th class="column-title">DAO CIF</th>
                            <th class="column-title">DAO SẢN PHẨM</th>
                            <th class="column-title">GHI CHÚ</th>
                            <th class="column-title">NGÀY HIỆU LỰC</th>
                        </tr>
                    </thead>
                    <tbody></tbody>
                </table>
            </div>
        </div>
    </div>
</div>

@section scripts
{
    <script src="~/Scripts/custom_search_table.js"></script>
    <!-- bootstrap-daterangepicker -->
    <script src="~/scripts/datepicker/moment/moment.min.js"></script>
    <script src="~/scripts/datepicker/datepicker/daterangepicker.js"></script>
    <script src="~/scripts/tableeditable/dataTables.rowsGroup.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var lcColumn = [
                            { "sName": "CIF", "bSortable": false },
                            { "sName": "NAME", "bSortable": false },
                            { "sName": "VPB INDUSTRY", "bSortable": false },
                            { "sName": "DATE MOVING IN", "bSortable": false },
                            { "sName": "DATE MOVING IN", "bSortable": false },
                            { "sName": "DATE MOVING IN", "bSortable": false },
                            { "sName": "DATE MOVING IN", "bSortable": false },
                            { "sName": "DATE MOVING IN", "bSortable": false },
                            { "sName": "INFO", "className": 'column-title details-control', "bSortable": false }];
            var lcLenCol = 5;
            var lcCifCol = 0;
            var tablebadbank = $('#cm-alert-badbank').DataTable({
                "order": [[0, 'asc']],
                "bServerSide": true,
                "bProcessing": true,
                "responsive": true,
                "bAutoWidth": false,
                "aLengthMenu": [10, 30, 50, 100],
                "pageLength": 10,
                rowsGroup: [0, 1, 2],
                "sAjaxSource": '@Url.Action("RawbBadbankData", "SalePerformance")' + '?dao=@Model.Dao',
                "fnServerData": function (sSource, aoData, fnCallback) {
                    $.ajax({
                        "dataType": 'json',
                        "type": "POST",
                        "url": sSource,
                        "data": aoData,
                        "success": fnCallback
                    });
                },
                "sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'dataTables_wrapper'ip>>",
                "sPaginationType": "simple_numbers",//"full_numbers",
                "aoColumns": lcColumn,
                "aoColumnDefs": [],
                initComplete: function () {
                    @*this.api().columns().every(function () {
                        var column = this;
                        switch (column.context[0].aoHeader[0][column.index()].cell.innerText) {
                            case '@Html.Raw(SMECustomerWebsite.Core.Resources.Resource.Zone.ToUpper())':
                                createFilterRegion(column, '@Html.Raw(SMECustomerWebsite.Core.Resources.Resource.Zone)');
                                break;
                            case '@Html.Raw(SMECustomerWebsite.Core.Resources.Resource.NoOverdueHeader)':
                                createFilterRange(column,1,90,1);
                                break;
                            case '@Html.Raw(SMECustomerWebsite.Core.Resources.Resource.Branch.ToUpper())':
                                createFilterBranch(column);
                                break;
                            case '@Html.Raw(SMECustomerWebsite.Core.Resources.Resource.MSBONameHeader.ToUpper())':
                                createFilterMSBOName(column, 1);
                                break;
                            case 'DAO':
                                createFilterMSBOName(column, 2);
                                break;
                            default:
                                if (column.index() < lcLenCol) {
                                    var select = $('<input type="text" class="filtet-table">')
                                                            .appendTo($(column.header()))
                                                            .on('keyup change', function () {
                                                                column.search(this.value).draw();
                                                            });
                                }
                                break;
                        }
                    });*@
                },
                "drawCallback": function (settings) {
                    $('table.custom_table th').removeClass().addClass('column-title');
                }
            });
        })
    </script>
}
